<?php
namespace app\index\controller;
use \think\facade\Hook;
use think\request;
use app\admin\model\User as UserModel;
use app\admin\model\Good;

class Index 
{
    public function index(request $request,Good $good)
    {
         // var_dump($request->remotePort);
      // var_dump($request->method());
     
      $res = NULL;
       if($id =cookie('uid')){
           $res = UserModel::where('id',$id)->find();
       }
      $g_info = $good->all();

       return view('index',['userinfo'=>$res,'good'=>$g_info]);
       
    }
    /**
     * @param  string  $name 数据名称
     * @return mixed
     * @route('hello/:name')
     */
    public function chisha()
    {
        
       return view('chisha');
    }

    public function test()
    {
        
       return view('test');
    }

}
